package com.json.service.impl;

import com.json.dao.StudentDAO;
import com.json.dao.impl.StudentDAOImpl;
import com.json.entity.Student;
import com.json.service.StudentService;

import java.util.List;

/*
* 学生业务逻辑实现类
* */
public class StudentServiceImpl implements StudentService {

    private StudentDAO studentDAO = new StudentDAOImpl();
    @Override
    public List<Student> findAllStudents() {
        return studentDAO.selectAllStudents();
    }
    @Override
    public List<Student> findByKeyWord(String keyword){
        return studentDAO.selectByKeyWord(keyword);
    }
    @Override
    public List<Student> findById(Integer id){
        return studentDAO.selectById(id);
    }
    @Override
    public boolean add(String name,Integer age,String cellphone,String address,String gender){
        return studentDAO.insert(name,age,cellphone,address,gender);
    }
    @Override
    public boolean update(String name,Integer age,String cellphone,String address,String gender,Integer id){
        return studentDAO.update(name,age,cellphone,address,gender,id);
    }
    @Override
    public boolean remove(Integer id){
        return studentDAO.delete(id);
    }
}
